package com.medicine.product.study.singleton;

/**
 * @author lynn
 * @version 1.0
 * @date 2022/2/14
 */
//双重检索
public class JianSingleton {
    private static volatile JianSingleton instance;

    private JianSingleton(){

    }

    public static JianSingleton getInstance(){
        if(instance==null){
            synchronized (JianSingleton.class){
                if(instance==null){
                    instance = new JianSingleton();
                }
            }
        }
        return instance;
    }
}
